package com.hw.controller;

import com.hw.dao.UserDao;
import com.hw.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @author F1335240
 * @version 1.0
 * @date 2020/5/8 9:58
 **/
@Controller
@RequestMapping("")
public class UserController {

    @Resource
    private UserDao userDao;

    @RequestMapping("/add")
    public void add() {
        User user = new User();
        user.setUsername("daweizai");
        user.setPassword("123456");
        int insert = userDao.insert(user);
        if (insert > 0) {
            System.out.println("添加用户信息成功");
        } else {
            System.out.println("添加用户信息失败");
        }

    }
}
